package com.bristua.mall.user.controller;

import com.bristua.mall.common.bean.Result;
import com.bristua.mall.common.utils.HandleResultUtil;
import com.bristua.mall.user.biz.UserPhoneBindBiz;
import com.bristua.mall.user.enums.UserCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/4/28.
 */
@RestController
@Api(value="用户完善信息",tags={"用户完善信息"})
public class UserPhoneBindController {

    @Autowired
    private UserPhoneBindBiz userPhoneBindBiz;
    @ApiOperation(value="用户完善信息")
    @PostMapping(value = "/api/user/bind/phone/{phone}/{code}/{inviteCode}")
    public Result updatePhoneBind(@PathVariable(value = "phone") String phone, @PathVariable(value = "code")String code,  @PathVariable(value = "inviteCode")String inviteCode){
        userPhoneBindBiz.userPhoneBind(phone,code,inviteCode);
        return HandleResultUtil.commonResult(UserCode.USER_BIND_PHONE_SUCCESS.getCode(),UserCode.USER_BIND_PHONE_SUCCESS.getMsg());
    }
}
